#!/bin/sh
#
# This bootstrap file has been inspired by Bootstraping chapter
# in Autobook by Vaughan, Elliston, Tromey and Taylor.
# http://sources.redhat.com/autobook/

set -x

if [ ! -d configure.aux ]; then
  mkdir configure.aux
fi

# required by autoconf
hg log --style changelog > ChangeLog

# generate Mercurial's id
echo '#define CHANGESET "Mercurial changeset ' `hg id` '"' > include/hgid.h

# add -I for localy installed wxwin.m4
if [ -d /usr/local/share/aclocal/ ]; then
  aclocdir="-I /usr/local/share/aclocal/"
fi

aclocal $aclocdir \
&& automake --gnu --add-missing --copy \
&& autoconf

#./configure FCFLAGS="-Wall -g -p -fbounds-check -fimplicit-none -fbacktrace" CFLAGS="-Wall -g -p -fbounds-check"  CXXFLAGS="-D__WXDEBUG__ -g -p -Wall -fbounds-check"

# for gfortran > 4.5.x
#./configure FCFLAGS="-Wall -g -p -fcheck=all -fbacktrace -fimplicit-none" CFLAGS="-Wall -g -p"  CXXFLAGS="-D__WXDEBUG__ -g -p -Wall"
